package cn.tedu.tmall.admin.mall.service;

import cn.tedu.tmall.admin.mall.dao.persist.mapper.GoodMapper;
import cn.tedu.tmall.admin.mall.pojo.param.GoodsAddNewParam;
import cn.tedu.tmall.admin.mall.pojo.param.GoodsUpdateInfoParam;
import cn.tedu.tmall.admin.mall.pojo.vo.GoodsListItemVO;
import cn.tedu.tmall.admin.mall.pojo.vo.GoodsStandardVO;
import cn.tedu.tmall.common.consts.data.CommonConsts;
import cn.tedu.tmall.common.consts.data.MallConsts;
import cn.tedu.tmall.common.pojo.authentication.CurrentPrincipal;
import cn.tedu.tmall.common.pojo.vo.PageData;
import org.springframework.transaction.annotation.Transactional;

@Transactional
public interface IGoodService extends CommonConsts, MallConsts {
    void addNew(CurrentPrincipal currentPrincipal, GoodsAddNewParam goodsAddNewParam);
    void delete(Long id);
    void updateById(Long id, GoodsUpdateInfoParam goodsUpdateInfoParam);

    //根据商品id查询商品
    GoodsStandardVO selectById(Long id);
    //查询商品列表
    PageData<GoodsListItemVO> list(Integer pageNum);
    PageData<GoodsListItemVO> list(Integer pageNum, Integer pageSize);
    //根据类别查询商品列表
    PageData<GoodsListItemVO> listByCategoryId(Long categoryId, Integer pageNum);
    PageData<GoodsListItemVO> listByCategoryId(Long categoryId, Integer pageNum, Integer pageSize);

    //将数据放入ElasticSearch中
    void rebuildSearch();
}
